<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBookTypeTable extends Migration
{
    /**
     * 书籍分类表
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('book_type', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name', 255)->comment('名称');
            $table->string('ico', 255)->nullable()->comment('分类图片');
            $table->char('pid', 11)->default(0)->comment('上级id');
            $table->char('model_id', 11)->default(0)->comment('模块id:1小说；2漫画');
            $table->char('sort', 11)->default(0)->comment('排序');
            $table->char('status', 1)->default(0)->comment('状态0:删除1:开启');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('book_type');
    }
}
